<%--
  Created by IntelliJ IDEA.
  User: 14258
  Date: 2020/9/9
  Time: 0:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>自动填充</title>
    <script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
    <script>
        $(function () {
            $("#uid").blur(function () {
                var userid = $(this).val();
                $.ajax({
                   url:"/getuser",
                   data:"uid="+userid,
                   type:"post",
                    dataType:"JSON",
                    success:function (result) {
                       $("#uname").val(result.name);
                    }
                });
            });
        });
    </script>
</head>
    <body>
        userID:<input type="text" id="uid">
        userName:<input type="text" id="uname">
    </body>
</html>
